<template>
  <div class="leftItem">
    <div class="leftImg" @click="toDetail(childMsg.id)">
      <img :src="childMsg.imgUrlIcon" alt="">
    </div>
    <div class="leftContent">
      <div @click="toDetail(childMsg.id)" class="cursor">{{childMsg.name}}</div>
      <div @click="toDetail(childMsg.id)" class="cursor">{{childMsg.gameSize}}</div>
      <!--<el-button :class="childMsg.chosed? chosed : ''">立即下载</el-button>-->
      <a class="downBtn" :href="childMsg.downloadUrl" download>立即下载</a>
    </div>
  </div>
</template>

<script>
export default {
  name: 'leftList',
  props: [ 'childMsg' ],
  data () {
    return {
      msg: ''
    }
  },
  methods: {
    toDetail (id) {
      this.$router.push({path: '/detail', query: { userId: id }})
    }
  },
  mounted: function () {
    this.$nextTick(function () {
      // Code that will run only after the
      // entire view has been rendered
    })
  }
}
</script>
<style scoped>
  .leftItem{
    display: flex;
    flex-direction: row;
    text-align: center;
    margin-right: 12px;
    padding:10px;
  }
  .leftItem:hover{
    background-color: rgba(245, 245, 245, 1);
  }
  .cursor{
    cursor: pointer;
  }
  .leftImg img{
    width: 80px;
    height: 80px;
  }
  .leftContent{
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .leftContent :first-child{
    margin-bottom: 5px;
  }
  .leftContent :nth-child(2){
    margin-bottom: 5px;
  }
  .chosed{
    background-color: red;
  }
.downBtn{
  display: block;
  width: 65px;
  height: 28px;
  line-height: 28px;
  background-color: rgba(0, 150, 136, 1);
  color: rgba(255, 255, 255, 1);
  font-size: 12px;
  text-align: center;
  font-family: Microsoft Yahei;
  box-sizing: border-box;
  margin: 4px 0 0 10px;
  cursor: pointer;
}
</style>
